package com.milk.milkmedia.dao;

import android.content.Context;

import com.umeng.community.example.CommunityApplication;

/**
 * Created by 微安 on 2015/7/29.
 */
public class DBManager {
    private static DBManager instance;
    public Context mContext;
    private FrameDBHelper mFrameBDHelper;
    private MusicInfoDBHelper iMusicInfoBDHelper;
    private UserInfoDBHelper mUserInfoDBHelper;
    private DBManager() {

        mContext = CommunityApplication.getInstance().getApplicationContext();
    }

    public static DBManager getInstance() {
        if (instance == null) {
            instance = new DBManager();
        }
        return instance;
    }

    public FrameDBHelper getFrameDBHelper() {
        if (mFrameBDHelper == null) {
            mFrameBDHelper = new FrameDBHelper(mContext);
        }
        return mFrameBDHelper;
    }

    public MusicInfoDBHelper getMusicInfoBDHelper(){
        if (iMusicInfoBDHelper == null){
            iMusicInfoBDHelper = new MusicInfoDBHelper(mContext);
        }
        return iMusicInfoBDHelper;
    }

    public UserInfoDBHelper getUserInfoDBHelper(){
        if (mUserInfoDBHelper == null){
            mUserInfoDBHelper = new UserInfoDBHelper(mContext);
        }
        return mUserInfoDBHelper;
    }
}
